package basic.thread.again;

import java.util.Arrays;
import java.util.List;

/**
 * @author bingo
 * @create 2018-02-16 14:34
 **/
public class Demo5 {

    public static void main(String[] args) {
        Demo5 demo5 = new Demo5();
        Integer result= demo5.add(Arrays.asList(10,20,30,40));
        System.out.println("result:"+result);
    }
    public int add(List<Integer> values){
       values.parallelStream().forEach(System.out::println);
        return  values.parallelStream().mapToInt(a->a).sum();

    }

}
